#include "PreCompiled.h"
#include "EntityTopProperty.h"

EntityTopProperty::EntityTopProperty(const char* name)
: EntityProperty(name)
{

}

EntityTopProperty::~EntityTopProperty(void)
{
}

void EntityTopProperty::addEntityProperty()
{
     
}
void EntityTopProperty::onChange()
{
   
}

void EntityTopProperty::setProperty()
{

 	for(std::vector<EntityProperty*>::iterator it = _matList.begin(); it != _matList.end(); it++)
 	{
		//mat
         (*it)->setProperty();
 	}
}

void EntityTopProperty::addProperty(EntityProperty* pro)
{
   _matList.push_back(pro);
}

// ------------ [5/13/2013 Administrator]
TopPropertyManager* TopPropertyManager::_instance = 0;
TopPropertyManager::TopPropertyManager()
{

}
TopPropertyManager::~TopPropertyManager()
{

}
TopPropertyManager* TopPropertyManager::Instance()
{
	if(_instance == 0)
		_instance = new TopPropertyManager;
	return _instance;
}

void TopPropertyManager::addProperty(EntityProperty* pro)
{
   TopList.push_back(dynamic_cast<EntityTopProperty*>(pro));
}
void TopPropertyManager::remvoeProperty(EntityProperty* pro)
{
	for (std::vector<EntityTopProperty*>::iterator it = TopList.begin(); it!= TopList.end(); it++)
   {
       if((*it) == pro)
	   {
		   delete *it;
		   TopList.erase(it);
		   break;
	   }
   }
}

void TopPropertyManager::setProperty()
{
	for(std::vector<EntityTopProperty*>::iterator it = TopList.begin(); it != TopList.end(); it++)
	{
		if((*it)->hasChild())
		{
           
		}
	}
}
